gtk4.git
11 years agoHighContrast: Fix a typo
Matthias Clasen [Sat, 21 Mar 2015 00:48:25 +0000 (20:48 -0400)]
HighContrast: Fix a typo

Commit 0a39d7d9 introduced a selected_bg_color with a missing $
in front of it.

11 years agoUpdated Hungarian translation
Gábor Kelemen [Fri, 20 Mar 2015 23:23:24 +0000 (23:23 +0000)]
Updated Hungarian translation

11 years agoUpdated Hungarian translation
Balázs Úr [Fri, 20 Mar 2015 22:57:03 +0000 (22:57 +0000)]
Updated Hungarian translation

11 years agoreftests: Add a way to compare different runs
Matthias Clasen [Fri, 20 Mar 2015 20:39:36 +0000 (16:39 -0400)]
reftests: Add a way to compare different runs

gtk-reftest already had an --output=DIR option to tell it where
to save all the resulting images. Now you can combine this with
the --compare-with=DIR option in a second run to make gtk-reftest
compare the .out.png files from the first run with the .out.png
files of the current run, instead of producing .ref.png files.

The intended use for this is to verify that changes do not affect
the generated output.

11 years agomir: Fix version annotation, the mir-backend is available since 3.16
Rico Tzschichholz [Fri, 20 Mar 2015 19:18:44 +0000 (20:18 +0100)]
mir: Fix version annotation, the mir-backend is available since 3.16

11 years agofix insensitive and backdrop states
Jakub Steiner [Fri, 20 Mar 2015 12:22:47 +0000 (13:22 +0100)]
fix insensitive and backdrop states

- checkboxes, labels and buttons were a mixed bag for
  :insensitive and :backdrop

https://bugzilla.gnome.org/show_bug.cgi?id=746188

11 years agoHighContrast: fix insensitive labels
Matthias Clasen [Fri, 20 Mar 2015 10:20:30 +0000 (06:20 -0400)]
HighContrast: fix insensitive labels

Make insensitive labels differerent from regular labels.

https://bugzilla.gnome.org/show_bug.cgi?id=746493

11 years agogtk-demo: Plug a memory leak
Matthias Clasen [Fri, 20 Mar 2015 02:57:10 +0000 (22:57 -0400)]
gtk-demo: Plug a memory leak

11 years agowidget-factory: Fix toolbar on page 3
Matthias Clasen [Thu, 19 Mar 2015 23:11:39 +0000 (19:11 -0400)]
widget-factory: Fix toolbar on page 3

Set toolbar-style to 'icons' to avoid rectangular buttons.

11 years agoUpdated Norwegian bokmål translation.
Kjartan Maraas [Thu, 19 Mar 2015 20:13:10 +0000 (21:13 +0100)]
Updated Norwegian bokmål translation.

11 years agoinspector: show accessible name and description
Vadim Rutkovsky [Thu, 19 Mar 2015 11:00:01 +0000 (12:00 +0100)]
inspector: show accessible name and description

11 years agowayland: Silence warnings on clipboard data sending cancellation
Carlos Garnacho [Thu, 19 Mar 2015 14:58:00 +0000 (15:58 +0100)]
wayland: Silence warnings on clipboard data sending cancellation

During copy/paste, it may be common that we receive several property changes
around the selection atom, this results in warnings when cancelling the previous
write attempt. We already honor the last request properly, so we should just
cancel silently.

11 years agowayland: Ensure we re-request the target if the fd changes
Carlos Garnacho [Thu, 19 Mar 2015 14:54:48 +0000 (15:54 +0100)]
wayland: Ensure we re-request the target if the fd changes

If we receive wl_data_source.target before .send, the target would already
be cached, but we'd take no action on the new fd.

11 years agowayland: Don't accept the "TARGETS" target on the wl_data_offer
Carlos Garnacho [Thu, 19 Mar 2015 14:49:04 +0000 (15:49 +0100)]
wayland: Don't accept the "TARGETS" target on the wl_data_offer

This is handled separately through the data already cached from the
wl_data_offer.offer handler, we can avoid this request entirely then.

11 years agoUpdated Serbian translation
Милош Поповић [Thu, 19 Mar 2015 13:20:12 +0000 (13:20 +0000)]
Updated Serbian translation

11 years agoAdwaita: Fix context menu shadows not showing up
Benjamin Otte [Thu, 19 Mar 2015 02:54:38 +0000 (03:54 +0100)]
Adwaita: Fix context menu shadows not showing up

11 years agoinspector: Make it easier to cut'n'paste advice message
Bastien Nocera [Wed, 18 Mar 2015 10:44:40 +0000 (11:44 +0100)]
inspector: Make it easier to cut'n'paste advice message

The message says "Enable statistics with GOBJECT_DEBUG=instance-count"
but the message itself isn't selectable, making it hard to cut'n'paste.

https://bugzilla.gnome.org/show_bug.cgi?id=746391

11 years agocsspathnode: Handle context going away
Benjamin Otte [Wed, 18 Mar 2015 17:22:17 +0000 (18:22 +0100)]
csspathnode: Handle context going away

Sometimes path nodes can survive longer than the style context that
created them. Don't crash in those cases.

Fixes startup of mutter.

Testcase included.

https://bugzilla.gnome.org/show_bug.cgi?id=746407

11 years agoinspector: Add a new page that lists the CSS node tree
Benjamin Otte [Mon, 2 Mar 2015 23:02:25 +0000 (00:02 +0100)]
inspector: Add a new page that lists the CSS node tree

11 years agocssnode: Add properties
Benjamin Otte [Thu, 5 Mar 2015 19:29:37 +0000 (20:29 +0100)]
cssnode: Add properties

11 years agocsswidgetnode: Use style_changed signal instead of update_style vfunc
Benjamin Otte [Thu, 5 Mar 2015 16:51:23 +0000 (17:51 +0100)]
csswidgetnode: Use style_changed signal instead of update_style vfunc

11 years agocssnode: Add a style-changed signal
Benjamin Otte [Thu, 5 Mar 2015 16:35:57 +0000 (17:35 +0100)]
cssnode: Add a style-changed signal

The signal gets emitted whenever the style needs to be changed.

11 years agocssnode: Add node-added and node-removed signal
Benjamin Otte [Sun, 1 Mar 2015 20:33:54 +0000 (21:33 +0100)]
cssnode: Add node-added and node-removed signal

This allows monitoring the CSS tree. For now, moving a child to a
different position relative to its siblings while keeping the same
parent will cause a child-added + child-removed emission.

11 years agocssnode: Track invalid children
Benjamin Otte [Sun, 1 Mar 2015 12:14:01 +0000 (13:14 +0100)]
cssnode: Track invalid children

We need to properly track if a node needs to propagate invalidation
state information to its children. We didn't do this properly before and
that could lead to us forgetting to invalidate nodes in corner cases.

11 years agocsswidgetnode: Avoid creating a stylecontext
Benjamin Otte [Thu, 5 Mar 2015 05:23:35 +0000 (06:23 +0100)]
csswidgetnode: Avoid creating a stylecontext

If the widget doesn't have a style context, don't create one. Instead,
call functions on the widget directly.

11 years agocssnode: Change the way we invalidate timestamps
Benjamin Otte [Sat, 28 Feb 2015 01:22:38 +0000 (02:22 +0100)]
cssnode: Change the way we invalidate timestamps

Do not propagate the TIMESTAMP change through the node tree, as that
causes lots of uneeded markings of nodes as invalid.

Instead, walk the node tree and find the nodes that have a non-static
style and only invalidate timestamps on those.

11 years agocssstyle: Add gtk_css_style_is_static()
Benjamin Otte [Fri, 27 Feb 2015 17:41:13 +0000 (18:41 +0100)]
cssstyle: Add gtk_css_style_is_static()

Gets rid of the need to do

  if (ANIMATED_STYLE() &&
      animated_style_is_static(ANIMATED_STYLE(style))

11 years agocssnode: Special-case TIMESTAMP invalidations
Benjamin Otte [Wed, 25 Feb 2015 17:25:01 +0000 (18:25 +0100)]
cssnode: Special-case TIMESTAMP invalidations

Only invalidate timestamps if the node is marked as invalid. We overload
the meaning of "invalid" as "tracks timestamps".

While I don't like the way this is written, it is an important
optimization because 95+% of nodes don't animate so timestamps don't
matter to them. But timestamps are invalidated 60x per second.

11 years agocssnode: Redo style changed tracking
Benjamin Otte [Wed, 25 Feb 2015 17:05:07 +0000 (18:05 +0100)]
cssnode: Redo style changed tracking

We don't return a NULL style to mean "no changes" anymore, instead
we check new_style == old_style to mean that.

Make sure the code reflects this, otherwise we'll send
GTK_CSS_CHANGE_PARENT_STYLE invalidations everywhere and screw up
performance.

11 years agostylecontext: Call get_style(), not create_style()
Benjamin Otte [Mon, 23 Feb 2015 02:06:02 +0000 (03:06 +0100)]
stylecontext: Call get_style(), not create_style()

We want to ensure that the style is created properly.

This also allows making the create_Style() function private.

11 years agocssnode: Merge the 2 places that compute styles
Benjamin Otte [Sun, 22 Feb 2015 22:28:04 +0000 (23:28 +0100)]
cssnode: Merge the 2 places that compute styles

Now that the widget node recomputes styles on update_style() we can just
call it during validate(). That way, we don't need the widget node to
manually compute its style.

11 years agocssnode: Always return correct style values
Benjamin Otte [Sun, 22 Feb 2015 22:11:22 +0000 (23:11 +0100)]
cssnode: Always return correct style values

If CSS values are queried from a widget, recompute them if necessary. Do
not emit style-updated until the validation phase however.

This way, we don't run into performance traps when style-update causes
invalidations that cause new style-updated to be emitted.

11 years agocssstyle: Add optimization
Benjamin Otte [Sun, 22 Feb 2015 17:04:43 +0000 (18:04 +0100)]
cssstyle: Add optimization

There is no difference between a style and itself.

11 years agostylecontext: Refactor gtk_style_context_invalidate()
Benjamin Otte [Sun, 22 Feb 2015 07:26:29 +0000 (08:26 +0100)]
stylecontext: Refactor gtk_style_context_invalidate()

There's no need anymore to recreate styles, nodes do that automagically
now.

This allows making gtk_css_node_set_style() private.

11 years agocssnode: Create animated styles by default
Benjamin Otte [Sun, 22 Feb 2015 07:23:04 +0000 (08:23 +0100)]
cssnode: Create animated styles by default

... and hardcode transient and path nodes to never create animated
styles.

11 years agocssnode: Add optimization
Benjamin Otte [Sun, 22 Feb 2015 05:19:33 +0000 (06:19 +0100)]
cssnode: Add optimization

Don't even try to propagate changes when we know there are none.

11 years agocssnode: Change the way we start animations
Benjamin Otte [Sat, 21 Feb 2015 02:40:46 +0000 (03:40 +0100)]
cssnode: Change the way we start animations

We now have a flag for "invalidate animations", use that to restart
animations and decide if we want to start transitions.

11 years agocssnode: Return NULL as frame clock when animations are disabled
Benjamin Otte [Fri, 20 Feb 2015 23:16:58 +0000 (00:16 +0100)]
cssnode: Return NULL as frame clock when animations are disabled

This is a crude hack, but it works.

FIXME: Hook it up to the GtkSettings so that we properly update when the
setting changes.

11 years agocssstyle: Handle 0 timestamp to mean "don't animate"
Benjamin Otte [Fri, 20 Feb 2015 23:15:04 +0000 (00:15 +0100)]
cssstyle: Handle 0 timestamp to mean "don't animate"

11 years agocssnode: Move style context function to only user
Benjamin Otte [Fri, 20 Feb 2015 16:36:10 +0000 (17:36 +0100)]
cssnode: Move style context function to only user

11 years agocssnode: Remove timestamp from gtk_css_node_validate()
Benjamin Otte [Fri, 20 Feb 2015 16:28:23 +0000 (17:28 +0100)]
cssnode: Remove timestamp from gtk_css_node_validate()

GtkCssNode knows its own timestamp.

11 years agocssnode: Add API to query the timestamp
Benjamin Otte [Wed, 18 Feb 2015 23:54:14 +0000 (00:54 +0100)]
cssnode: Add API to query the timestamp

... and pass it to the API that computes new styles.

A special timestamp of 0 means "please don't animate" and is used when
no frame clock is available for a node.

11 years agocssnode: Make parent style change part of GtkCssNode
Benjamin Otte [Wed, 18 Feb 2015 05:01:41 +0000 (06:01 +0100)]
cssnode: Make parent style change part of GtkCssNode

11 years agocssnode: Propagate pending changes after recomputing new style
Benjamin Otte [Wed, 18 Feb 2015 04:55:38 +0000 (05:55 +0100)]
cssnode: Propagate pending changes after recomputing new style

This way we can propagate if the new style actually changed anything.

11 years agocssnode: Add gtk_css_node_invalidate_style_provider()
Benjamin Otte [Tue, 17 Feb 2015 15:11:38 +0000 (16:11 +0100)]
cssnode: Add gtk_css_node_invalidate_style_provider()

This function not just invalidates the current node, but also all
children.

11 years agocssnode: Change get_style_provider() vfunc
Benjamin Otte [Tue, 17 Feb 2015 14:18:32 +0000 (15:18 +0100)]
cssnode: Change get_style_provider() vfunc

Instead of always returning a provider, allow the vfunc to return NULL
to mane "use same provider as parent". This allows a bunch of
optimizations.

11 years agocssnode: Implement a way to properly track invalidations
Benjamin Otte [Tue, 17 Feb 2015 04:01:09 +0000 (05:01 +0100)]
cssnode: Implement a way to properly track invalidations

See the comment in gtkcssnodeprivate.h for how this works.

11 years agocssnode: Change vfunc
Benjamin Otte [Sat, 14 Feb 2015 05:45:21 +0000 (06:45 +0100)]
cssnode: Change vfunc

This is mainly an attempt to merge the update_style() and validte()
vfuncs. Code is not there yet, but that's the idea.

Also, gtk_css_node_set_style() should not be public. And this gets
closer to that goal, too.

11 years agocssnode: Only pass a boolean for parent changes
Benjamin Otte [Sat, 14 Feb 2015 05:40:00 +0000 (06:40 +0100)]
cssnode: Only pass a boolean for parent changes

Nobody cares what changed in the parent, so don't track it.

11 years agocssvalue: Remove GtkCssDependencies
Benjamin Otte [Sat, 14 Feb 2015 01:27:39 +0000 (02:27 +0100)]
cssvalue: Remove GtkCssDependencies

They are not used anymore.

11 years agocssstyle: Remove unused optimization
Benjamin Otte [Sat, 14 Feb 2015 00:59:17 +0000 (01:59 +0100)]
cssstyle: Remove unused optimization

After measuring it, I realized the optimization never triggers for
Adwaita and rarely ever triggers for simple themes. So it is not
useful to keep it around.

11 years agocsswidgetnode: Always return a valid style
Benjamin Otte [Fri, 13 Feb 2015 21:04:26 +0000 (22:04 +0100)]
csswidgetnode: Always return a valid style

11 years agocsspathnode: Call gtk_style_context_validate()
Benjamin Otte [Fri, 13 Feb 2015 21:00:06 +0000 (22:00 +0100)]
csspathnode: Call gtk_style_context_validate()

Don't call gtk_style_context_invalidate(), that function does too much
work.

11 years agotestsuite: Add another random stylecontext test
Benjamin Otte [Fri, 13 Feb 2015 20:21:46 +0000 (21:21 +0100)]
testsuite: Add another random stylecontext test

11 years agocssnode: Use the frame clock's time
Benjamin Otte [Fri, 13 Feb 2015 18:57:55 +0000 (19:57 +0100)]
cssnode: Use the frame clock's time

... nstead of the monotonic time when validating a cssnode.

11 years agocssnode: Treat transient nodes as invisible nodes
Benjamin Otte [Fri, 13 Feb 2015 11:44:04 +0000 (12:44 +0100)]
cssnode: Treat transient nodes as invisible nodes

Making transient nodes invisible allows us to remove special cases
without any bad side effects and they continue working just like they
did before.

11 years agoreftests: Add a reftest for box sibling ordering
Benjamin Otte [Tue, 10 Feb 2015 01:53:28 +0000 (02:53 +0100)]
reftests: Add a reftest for box sibling ordering

11 years agocssnode: Add visibility concept
Benjamin Otte [Tue, 10 Feb 2015 01:50:57 +0000 (02:50 +0100)]
cssnode: Add visibility concept

This allows hiding nodes of invisible widgets.
And that in turn makes sure :nth-child() works as expected.

11 years agobox: Use CSS nodes instead of widget paths
Benjamin Otte [Mon, 9 Feb 2015 21:51:28 +0000 (22:51 +0100)]
box: Use CSS nodes instead of widget paths

This is a very simple patch that causes a bunch of overhead. But it
works.

11 years agowidget: Add gtk_widget_get_css_node()
Benjamin Otte [Mon, 9 Feb 2015 21:27:44 +0000 (22:27 +0100)]
widget: Add gtk_widget_get_css_node()

and replace gtk_style_context_get_root() with it.

11 years agocssnode: Refactor node tree modification code
Benjamin Otte [Mon, 9 Feb 2015 21:03:13 +0000 (22:03 +0100)]
cssnode: Refactor node tree modification code

This allows adding more API for it.

It also includes code that tracks modifications and invalidates siblings
and their positions whenever nodes get added or removed.

11 years agocssnode: Add hackery to allow bypassing widget paths
Benjamin Otte [Mon, 9 Feb 2015 17:38:57 +0000 (18:38 +0100)]
cssnode: Add hackery to allow bypassing widget paths

If we know the parent's get_path_for_child() implementation is safe to
be used with GtkCssNode because it doesn't do anything special, we do
that. Unfortunately that requires whitelisting vfuncs because the vfunc
is public API so anyone can override it.

11 years agocssnode: Remove now unused arg from vfunc
Benjamin Otte [Mon, 9 Feb 2015 16:26:07 +0000 (17:26 +0100)]
cssnode: Remove now unused arg from vfunc

11 years agocssnode: Add a matcher for nodes
Benjamin Otte [Mon, 9 Feb 2015 15:41:06 +0000 (16:41 +0100)]
cssnode: Add a matcher for nodes

... and use that matcher by default - ie for transient nodes.

11 years agocssnode: Make widget node not copy the path
Benjamin Otte [Mon, 9 Feb 2015 15:14:03 +0000 (16:14 +0100)]
cssnode: Make widget node not copy the path

Instead, use gtk_widget_get_path() which makes GtkWidget cache the path.
This is a temporary solution until we can get rid of widget paths.

This increases memory usage quite noticably.

11 years agocssnode: Make widget node use new matcher
Benjamin Otte [Mon, 9 Feb 2015 14:21:48 +0000 (15:21 +0100)]
cssnode: Make widget node use new matcher

11 years agocssnode: Make path node create matcher without copying
Benjamin Otte [Mon, 9 Feb 2015 10:29:48 +0000 (11:29 +0100)]
cssnode: Make path node create matcher without copying

... the WidgetPath. This uses the functionality introduced in the
previous commits.

11 years agocssmatcher: Allow widget path matcher to take a node declaration
Benjamin Otte [Mon, 9 Feb 2015 10:24:29 +0000 (11:24 +0100)]
cssmatcher: Allow widget path matcher to take a node declaration

The node declaration has the same functionality as
gtk_css_node_declaration_add_to_widget_path(). So instead of using that
function on a path, you can use the original path and the declaration in
a matcher.

11 years agocssnode: Split out a function
Benjamin Otte [Mon, 9 Feb 2015 08:41:48 +0000 (09:41 +0100)]
cssnode: Split out a function

So far the vfunc is kinda quirky (the path argument is an out argument
for something you have to free when you're done with the matcher), but
  I'm about to change that.

11 years agowidget: Create widget path classes from proper style
Benjamin Otte [Sun, 15 Feb 2015 21:26:13 +0000 (22:26 +0100)]
widget: Create widget path classes from proper style

We don't want to add the current classes to the widget path - which
might potentially be different after a gtk_style_context_save() - but
the root node's ones. So what better thing to do than actually using the
root node?

11 years agowidget: Use correct type for widgetpath creation
Benjamin Otte [Sun, 8 Feb 2015 15:44:11 +0000 (16:44 +0100)]
widget: Use correct type for widgetpath creation

This is relevant when the widget path is created while the widget is
still constructing. G_OBJECT_TYPE(widget) might not point to the final
type yet.

11 years agowidget: Create the CssNode
Benjamin Otte [Sun, 8 Feb 2015 15:37:08 +0000 (16:37 +0100)]
widget: Create the CssNode

... and pass it to the style context instead of having the style context
create it for us.

11 years agocssnode: Refactor invalidation propagation
Benjamin Otte [Sun, 8 Feb 2015 11:15:27 +0000 (12:15 +0100)]
cssnode: Refactor invalidation propagation

We want to be sure to gtk_css_node_invalidate() all potential changes.

11 years agostylecontext: Don't queue animate tick callbacks anymore
Benjamin Otte [Sat, 7 Feb 2015 18:03:37 +0000 (19:03 +0100)]
stylecontext: Don't queue animate tick callbacks anymore

Instead, just mark nodes permanently as invalid.

11 years agocssnode: Handle invalidate queueing differently
Benjamin Otte [Sat, 7 Feb 2015 17:53:07 +0000 (18:53 +0100)]
cssnode: Handle invalidate queueing differently

Instead of directly requesting the layout phase, register a tick
callback. This is what the docs suggest for animations and it's what we
need for the next commit.

11 years agocssnode: Change way invalidation is handled
Benjamin Otte [Sat, 7 Feb 2015 16:19:07 +0000 (17:19 +0100)]
cssnode: Change way invalidation is handled

Have a queue_validate() vfunc and a dequeue_validate() vfunc that are
called only on root nodes so they can queue a validation on their frame
clocks.

11 years agocssnode: Refactor gtk_css_widget_node_validate()
Benjamin Otte [Sat, 7 Feb 2015 09:30:27 +0000 (10:30 +0100)]
cssnode: Refactor gtk_css_widget_node_validate()

Makes it clearer what actually happens in that function.

11 years agocssnode: Only recreate styles when needed
Benjamin Otte [Thu, 5 Feb 2015 05:49:59 +0000 (06:49 +0100)]
cssnode: Only recreate styles when needed

11 years agocssnode: Automatically recreate style on get_style() call
Benjamin Otte [Wed, 4 Feb 2015 03:43:55 +0000 (04:43 +0100)]
cssnode: Automatically recreate style on get_style() call

When the style is invalid, redo it.

Make this a vfunc, so the widget nodes can opt out.

11 years agocssnode: Track pending changes here
Benjamin Otte [Tue, 3 Feb 2015 14:36:01 +0000 (15:36 +0100)]
cssnode: Track pending changes here

... instead of GtkCssWidgetNode.

11 years agostylecontext: Move gtk_style_context_validate() to GtkCssWidgetNode
Benjamin Otte [Mon, 2 Feb 2015 14:35:08 +0000 (15:35 +0100)]
stylecontext: Move gtk_style_context_validate() to GtkCssWidgetNode

11 years agostylecontext: Move style creation functions to CssNode code
Benjamin Otte [Mon, 2 Feb 2015 14:34:32 +0000 (15:34 +0100)]
stylecontext: Move style creation functions to CssNode code

11 years agostylecontext: Redo handling of differing state
Benjamin Otte [Sun, 1 Feb 2015 15:43:58 +0000 (16:43 +0100)]
stylecontext: Redo handling of differing state

Instead of passing an "override_state" flag, create a new CssNode just
for this simple lookup.

11 years agostylecontext: Get rid of stylecontext argument
Benjamin Otte [Sun, 1 Feb 2015 06:33:40 +0000 (07:33 +0100)]
stylecontext: Get rid of stylecontext argument

... to a bunch of functions.

This requires a tiny change to the heuristics for the style cache - we
now cache styles when they have the same style provider as their parent
instead of when they have the default provider - but that change doesn't
have any effect in practice.

11 years agocssnode: Add gtk_style_context_get_style_provider()
Benjamin Otte [Sat, 31 Jan 2015 15:30:05 +0000 (16:30 +0100)]
cssnode: Add gtk_style_context_get_style_provider()

... and use it when looking up properties.

11 years agostylecontext: Remove children list
Benjamin Otte [Fri, 30 Jan 2015 15:28:41 +0000 (16:28 +0100)]
stylecontext: Remove children list

It's not needed.

11 years agostylecontext: Move validation into GtkCssNode
Benjamin Otte [Fri, 30 Jan 2015 15:27:17 +0000 (16:27 +0100)]
stylecontext: Move validation into GtkCssNode

11 years agostylecontext: Export gtk_style_context_get_root()
Benjamin Otte [Fri, 30 Jan 2015 10:42:22 +0000 (11:42 +0100)]
stylecontext: Export gtk_style_context_get_root()

.. in the private header. This avoids tiny wrapper functions.

11 years agocssnode: Track invalid flag
Benjamin Otte [Wed, 28 Jan 2015 04:14:47 +0000 (05:14 +0100)]
cssnode: Track invalid flag

Remove it from GtkStyleContext.

11 years agocssnode: Implement refcounting
Benjamin Otte [Mon, 26 Jan 2015 05:13:01 +0000 (06:13 +0100)]
cssnode: Implement refcounting

The parent refs the child, so gtk_css_node_set_parent() adds/removes a
reference.

We should probably refactor this so that we name the function
parent.add(node) instead of node.set_parent(parent) - makes the
refcounting more clear.

11 years agostylecontext: Handle parent in CssNode code
Benjamin Otte [Mon, 26 Jan 2015 01:18:06 +0000 (02:18 +0100)]
stylecontext: Handle parent in CssNode code

Make CssNode a real tree with a DOM-like API.

11 years agostylecontext: Move relevant_changes tracking to GtkCssWidgetNode
Benjamin Otte [Sun, 25 Jan 2015 05:14:48 +0000 (06:14 +0100)]
stylecontext: Move relevant_changes tracking to GtkCssWidgetNode

11 years agocssnode: Handle invalidation
Benjamin Otte [Sun, 25 Jan 2015 01:40:40 +0000 (02:40 +0100)]
cssnode: Handle invalidation

Handle invalidation of node inside the CssNode code, don't do it in the
stylecontext.

11 years agostylecontext: Get rid of create_query_path()
Benjamin Otte [Sat, 24 Jan 2015 19:57:17 +0000 (20:57 +0100)]
stylecontext: Get rid of create_query_path()

Move that functionality into GtkCssNode.

11 years agostylecontext: Change arguments for build_properties
Benjamin Otte [Sat, 24 Jan 2015 19:52:34 +0000 (20:52 +0100)]
stylecontext: Change arguments for build_properties

Instead of passing the style declaration, take the node's style
declaration. Add arguments to allow overriding the state for the one
case where this didn't work.

11 years agostylecontext: Compute rootness of CssNode
Benjamin Otte [Sat, 24 Jan 2015 19:05:33 +0000 (20:05 +0100)]
stylecontext: Compute rootness of CssNode

.. instead of passing it as an argument.

11 years agostylecontext: Pass cssnode to build_properties
Benjamin Otte [Sat, 24 Jan 2015 18:51:05 +0000 (19:51 +0100)]
stylecontext: Pass cssnode to build_properties

11 years agostylecontext: Simplify a function
Benjamin Otte [Sat, 24 Jan 2015 18:44:47 +0000 (19:44 +0100)]
stylecontext: Simplify a function

11 years agostylecontext: Remove values cache
Benjamin Otte [Sat, 24 Jan 2015 17:55:54 +0000 (18:55 +0100)]
stylecontext: Remove values cache

The code is confusing the stylecontext=>node transition, so I'll remove
it.

WIth the recent introduction of the parent style cachen, I'm not sure
it's worth it at all. Some crude benchmarking suggests a slight speedup
when removing the cache.

So no guarantees about adding it back later.

11 years agocssnode: Split into 3 objects
Benjamin Otte [Mon, 12 Jan 2015 02:58:21 +0000 (03:58 +0100)]
cssnode: Split into 3 objects

- GtkCssWidgetNode
  for style contexts owned by a widget
- GtkCssPathNode
  for style contexts using a GtkWidgetPath
- GtkCssTransientNode
  for nodes created with gtk_style_context_save()/restore()